package com.yunji.cabinet.params;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.yunji.common.base.PageDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDate;

/**
 * @Project: yunji-coffee
 * @Package: com.yunji.cabinet.params
 * @Title: MaintainParam
 * <p>
 * History:
 * Date                     Version     Author          Summary
 * ============================================================
 * 2024-11-02 09:58:38      V1.0        HuaAo       新建类
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class RecordParam extends PageDTO {

    @ApiModelProperty("货柜ID")
    private Long containerId;
    @ApiModelProperty("补货 0-补货 1-换电")
    private Integer maintainType;
    @ApiModelProperty("代理商ID")
    private Long agentId;
    @ApiModelProperty("网点ID")
    private Long siteId;
    @ApiModelProperty("点位名称")
    private String locationName;
    @ApiModelProperty("员工姓名")
    private String staffName;
    @ApiModelProperty("货柜名称")
    private String containerName;
    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "开始时间")
    private LocalDate startTime;
    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "结束时间")
    private LocalDate endTime;

    public LocalDate getEndTime() {
        if (endTime != null)
            return endTime.plusDays(1);
        return null;
    }

}